<?php
namespace app\common\validate;

use think\Validate;

class AgentInfo extends Validate
{
    protected $rule = [
        'agent_id'   => 'require|unique:agent_info',
        'name'       => 'require',
        'avatar'     => 'require',
        'address'    => 'require',
        'lng'        => 'require',
        'lat'        => 'require',
        'tel'        => 'require',
        'info'       => 'require',
    ];

    protected $message = [
        'name'       => '{%name_require}',
        'avatar'     => '{%avatar_require}',
        'address'    => '{%address_require}',
        'lng'        => '{%lng_require}',
        'lat'        => '{%lng_require}',
        'tel'        => '{%tel_require}',
        'info'       => '{%info_require}',
    ];

    protected $scene = [
        'add'   => ['agent_id', 'name', 'avatar', 'address', 'lng', 'lat', 'tel', 'info'],
        'edit'  => ['name', 'avatar', 'address', 'lng', 'lat', 'tel', 'info'],
    ];
}